package com.xiaoyu.cloudmusic.controller;

import com.xiaoyu.cloudmusic.pojo.Banner;
import com.xiaoyu.cloudmusic.service.OthersServiceImpl;
import com.xiaoyu.cloudmusic.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
public class OthersController {
    @Autowired
    OthersServiceImpl othersService;

    @RequestMapping("/playList/banner")
    @ResponseBody
    public Result getBanner(){
        //去数据库查询banners
        List<Banner> banners=othersService.getAllBanners();

        return Result.ok("请求成功").put("banners",banners);
    }
}
